{% extends "accounts/base.html" %}
{% load avatars djblets_deco i18n %}

{% block title %}{% trans "Link Account" %}{% endblock %}

{% block auth_content %}
<div class="auth-header">
 <h1>{% trans "Connect account" %}</h1>
 <p>
{%  blocktrans %}
  It looks like you already have an account on {{PRODUCT_NAME}}.
  Log in with your existing password to complete SSO setup.
{%  endblocktrans %}
 </p>
 {% avatar user 175 %}
 <p>{{user.username}}</p>
{%  if form.errors %}
{%   errorbox %}{{form.non_field_errors}}{% enderrorbox %}
{%  endif %}
</div>

<form method="post" action="." class="auth-section main-auth-section"
      id="login_form">
{%  block hidden_fields %}
 <input type="hidden" name="next" value="{{next}}">
 <input type="hidden" name="username" value="{{form.username.value}}">
 {{form.provision}}
 {% csrf_token %}
{%  endblock %}

 <div class="auth-form-row auth-field-row">
  {{form.password.label_tag}}
  {{form.password}}
  {{form.errors.password}}
 </div>

 <div class="auth-form-row">
  <div class="auth-button-container">
   <input type="submit" class="primary" value="{% trans "Connect" %}">
  </div>
 </div>
</form>

<div class="auth-header">
 <h1>{% trans "Not you?" %}</h1>
 <p><a href="?mode=connect-login">{% trans "I have a different account" %}</a></p>
 <p>
{%  blocktrans %}
  Don't have an account? Please contact your system administrator about
  correcting the username in your SSO provider.
{%  endblocktrans %}
 </p>
</div>
{% endblock auth_content %}
